// component/searchBox/searchBox.js
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    search: {
      type: Boolean,
      value: true
    },
    navigate: {
      type: String,
      value: ""
    }
  },

  /**
   * 组件的初始数据
   */
  data: {
    hidden: 0
  },

  /**
   * 组件的方法列表
   */
  methods: {
    clickxianshi: function() {
      wx.navigateTo({
        url: this.properties.navigate
      })
    },
    searchNowData: function(e) {
      console.log(e.detail.value)
      this.setData({
        hidden: e.detail.value.length
      })
      var a = e.detail.value;
      var b;
      // setTimeout(function() {
      //  b = e.detail.value;
      //   // if (a == b) {
      //   //  myEventDetail.value=b;
      //   // }
      // }, 500)
      var myEventDetail = {
        value: a
      }
      this.triggerEvent('myevent', myEventDetail)
    }
  }
})